LD = g++
CXXFLAGS = -I/usr/include -I./include -lGL -lGLU -lglut -export-dynamic `pkg-config --cflags --libs gtk+-2.0 gtkglext-1.0 gtkglextmm-x11-1.2 libglademm-2.4 libglade-2.0` -ggdb
LDFLAGS = -L/usr/lib -lGL -lGLU -lglut -export-dynamic `pkg-config --cflags --libs gtk+-2.0 gtkglext-1.0 gtkglextmm-x11-1.2 libglademm-2.4 libglade-2.0` `sdl-config --cflags --libs` -lm -lSDL_image -ggdb
OBJ_DIR = obj/
SRC_DIR = src/
INC_DIR = include/
OBJS = $(OBJ_DIR)GUI_Scene.o $(OBJ_DIR)Application.o $(OBJ_DIR)Scene.o $(OBJ_DIR)Vertex3D.o $(OBJ_DIR)Mesh.o $(OBJ_DIR)Triangle.o $(OBJ_DIR)Object3D.o $(OBJ_DIR)Util.o $(OBJ_DIR)Camera.o $(OBJ_DIR)importar.o $(OBJ_DIR)main.o
EXE = bin/main

all: dirs $(EXE)

$(EXE): $(OBJS)
	$(LD) -o bin/main $(OBJS) $(CXXFLAGS)

$(OBJ_DIR)%.o : $(SRC_DIR)%.cpp $(INC_DIR)%.h
	g++ $(LDFLAGS) -Iinclude/ -c $< -o $@

dirs:
	@ if [ ! -d obj ]; then echo "Creating dirs ..."; mkdir obj; fi;
docum:
	@ if [ ! -d doc ]; then echo "Creating doc dirs ..."; mkdir doc; fi; doxygen doxyfile

clean:
	@echo Cleaning up...
	rm -f bin/main
	rm -f *~ $(OBJ_DIR)*.o
	rm -rf doc/*
	@echo Done.
